﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：ErrorInfo.cs
// 功能描述：TongTongMall.WebApi
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using System;

namespace TongTongMall.WebApi.Models
{
    /// <summary>
    /// 错误消息模块
    /// </summary>
    [Serializable]
    public class ErrorInfo
    {
        /// <summary>
        /// 错误码
        /// </summary>
        public int Code { get; set; }

        /// <summary>
        /// 错误消息
        /// </summary>
        public string Message { get; set; }

        /// <summary>
        /// 自定义错误返回数据
        /// </summary>
        public object Data { get; set; }

        public ErrorInfo()
        {
            
        }


        public ErrorInfo(string message)
        {
            Message = message;
        }


        public ErrorInfo(int code)
        {
            Code = code;
        }

        public ErrorInfo(int code, string message)
            : this(message)
        {
            Code = code;
        }

        public ErrorInfo(int code, string message, object data): this(message)
        {
            Code = code;
            Data = data;
        }
    }
}
